package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.mapper.ZsKeshiKucunMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lrkj.back.entity.ZsKeshiKucun;
import com.lrkj.back.service.ZsKeshiKucunService;
import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service("keshikucun")
public class ZsKeshiKucunServiceImpl extends ParentServiceImpl<ZsKeshiKucun> implements ZsKeshiKucunService {

    @Autowired
    private ZsKeshiKucunMapper kucunMapper;

    @Override
    protected DBInterface<ZsKeshiKucun> getDao() throws DBException {
        return kucunMapper;
    }

    @Override
    public List<ZsKeshiKucun> findAll(Map<String, Object> map) throws DBException {
        return kucunMapper.findAll(map);
    }

    @Override
    public PageInfo<ZsKeshiKucun> findAllPageInfo(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsKeshiKucun> list = kucunMapper.findAll(map);
        PageInfo<ZsKeshiKucun> kucunList = new PageInfo<ZsKeshiKucun>(list);
        return kucunList;
    }

    @Override
    public List<ZsKeshiKucun> findAllJifei(Map<String, Object> map) throws DBException {
        return kucunMapper.findAllJifei(map);
    }

    @Override
    public ZsKeshiKucun findOne(Map<String, Object> map) throws DBException {
        return kucunMapper.findOne(map);
    }

    @Override
    public int insertBatch(List<ZsKeshiKucun> list) throws DBException {
        return kucunMapper.insertBatch(list);
    }

    @Override
    public List<ZsKeshiKucun> findAllKucun(Map<String, Object> map) throws DBException {
        return kucunMapper.findAllKucun(map);
    }

    @Override
    public int updateByBatch(List<ZsKeshiKucun> list) throws DBException {
        return kucunMapper.updateByBatch(list);
    }

}
